'''
Created on 05.02.2020

@author: yu03
'''
import glob
import re
# -*- coding: utf-8 -*-
'''
Created on 05.02.2020

@author: yu03
'''
import datetime
import cv2
import matplotlib.pyplot as plt
from scipy import signal
from FFT_Interpolation import FFT_interpolation_2, line_cal, line_cal_fix
import numpy as np
import os
from scipy.optimize import curve_fit
from mpl_toolkits.mplot3d import Axes3D
from PyUeye_Unified.Cross_200line_SAAC import folder_path, np_names, hor_index, hor_lines, ver_lines, line_num
import sys
import time
import numpy as np
from multiprocessing import Pool
import multiprocessing

def run(data): # data = element in data_set
    print('start')
    res = np.fft.fft(data)
    time.sleep(3)
    print('finish')
    return res

if __name__ == "__main__":

    data_set = np.random.rand(5,10000) # (line,pix)
    pool = Pool(multiprocessing.cpu_count())
    result =pool.map(run, data_set) 
    pool.close()#关闭进程池，不再接受新的进程
    pool.join()#主进程阻塞等待子进程的退出
    t2 = time.time()

